#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
import time

def usage() :
	print "usage : %s type process_count thread_count user_count" % sys.argv[0]
	print "ex    : %s [item|mail|news] 2 10 50" % sys.argv[0]
	sys.exit()

if (len(sys.argv) != 5) : usage()


type, process_count, thread_count, user_count = sys.argv[1:]

for i in range(0, int(process_count)) :
	command = "./Main.py %s %d %d %d &" % (type, int(thread_count), int(user_count), i)
	print command
	os.system(command)
	time.sleep(0.5)
